#!/bin/bash

# fright配置文件
cp /media/config/frigate/config/config.yml /media/config/frigate/config/config.yml.bk
mkdir -p /media/config/frigate/config
touch /media/config/frigate/config/config.yml

# frigate
cat << EOF > /media/config/frigate/config/config.yml
mqtt:
#根据实际
#  host: 192.168.1.180
#  port: 1883
#  user: admin
#  password: HK123456
  enabled: false

birdseye:
  enabled: false
  mode: motion
  width: 1280
  height: 720
objects:
  track:
    - person
#    - car
#    - motorcyle
#    - cat
#    - dog   
        # Optional: list of objects to track from labelmap.txt (default: shown below)
ffmpeg:
  output_args:
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime
      1 -c:v copy -c:a aac
cameras:
  JK: # <------ Name the camera
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://admin:HK123456@192.168.1.100:554/rtsp
          roles:
            - detect

    motion:
      mask: 0.227,0,0,0,0,0.443,1,0.464,0.995,0.012
detect:
  height: 720
  width: 1280
  fps: 5
#开启7天
record:
  enabled: true
  retain:
    days: 2
#开启截图30天功能
snapshots:
  enabled: true
  retain:
    default: 2
version: 0.15-1
#auth:   # 找不到初始密码使用这2行，记得用完注释掉
#  reset_admin_password: true
EOF